//解析。vue组件页面的代码

//1.0导入vue这个包
import Vue from 'vue';


//使用mint-ui插件
//导入mint文件包
import MintUi from 'mint-ui';

//导入mint css 样式
import 'mint-ui/lib/style.css';

Vue.use(MintUi);

//引入vue-resource
import vueResource from 'vue-resource';
Vue.use(vueResource);


//引入mui的css样式
import '../statics/mui/css/mui.css';
import '../statics/mui/css/icons-extra.css';
import '../statics/css/site.css';



//2.0 导入App.vue 文件
import App from './App.vue';


//3.0vue-router相关代码
//3.01 导入vue-router这个包
import VueRouter from 'vue-router';

//3.02 在vue对象中通过use（）方法来使用vue-router对象
Vue.use(VueRouter)

//引入相应组建
import home from './components/Home.vue';
import newslist from './components/news/newslist.vue';
import newsView from './components/news/newsView.vue';
import imglist from './components/photo/imglist.vue';
import goodShow from './components/goods/goodShow.vue';
import video from './components/video/video.vue';
import pc from './components/demo/pc.vue';
import subpc1 from './components/demo/subpc1.vue';
import subpc2 from './components/demo/subpc2.vue';
import subpc3 from './components/demo/subpc3.vue';
import feedback from './components/feedback/feedback.vue';



import one from './components/news/one.vue';
// import home from './components/Home.vue';



var vueRouterObj = new VueRouter({
	linkActiveClass: 'mui-active',
	routes:[
		{path: '/', redirect: '/home'},
		{path: '/home', component: home},
		{path: '/news/newslist', component: newslist},
		{path: '/news/newsView/:index', component: newsView},
		{path: '/photo/imglist', component: imglist},
		{path: '/goods/goodShow', component: goodShow},
		{path: '/video/video', component: video},
		{path: '/feedback/feedback', component: feedback},
		{path: '/demo/pc', component: pc,children:[
			{path: '/demo/subpc1',component: subpc1},
			{path: '/demo/subpc2',component: subpc2},
			{path: '/demo/subpc3',component: subpc3}
			]},



		// {path: '/', component: search}

	]
});





//注册vue-preview 组件
import VuePreview from 'vue-preview'
Vue.use(VuePreview)

Vue.config.devtools = true

//3.0将App中的内容编译解析出来替换index.html中的<div>
new Vue({
	el: '#app',
	// render: function(create){
	// 	create(App);
	// }
	router: vueRouterObj,

	render:create=>create(App)
})